The present invention relates to an image coding method and apparatus therefor, and more particularly, to an image coding method and apparatus therefor for obtaining a scale factor in accordance with the complexity of the image and then quantizing the image, so as to encode images having different complexities at a constant bit rate.
Storage and communication technologies have rapidly developed due to recent advancements in the fields of computers, semiconductor manufacturing and digital signal processing. Further development requires improved methods for effectively storing image information on a recording medium and for increasing the quality of a reproduced image, processed in a digital image apparatus such as a digital videocassette recorder, high-definition television, digital video camera, video phone or television phone set. Here, the quantity of data for a digital image signal is much larger than that for an analog image signal, so that compression of the image data is necessary in order to effectively use recording media and communication channels. Methods used for image signal compression include a discrete cosine transform (DCT) method and a variable-length coding (VLC) method.
FIG. 1 is a block diagram illustrating the structure of a conventional image signal coding apparatus. In FIG. 1, a DCT unit 11 receives an input time-domain image block having a constant size (e.g., 8.times.8 pixels) and produces 64 discrete cosine coefficients in the frequency domain. A quantizer 12 quantizes the discrete cosine coefficients output from DCT unit 11, using a predetermined quantization step size. Then, a variable length coding (VLC) unit 13 produces variable length encoded data, such that data of less quantity (or whose information value is lower) is allotted fewer bits and data of greater quantity (or whose information value is higher) is allotted more bits, thus minimizing the number of bits required for coding. Since the length of the data output from VLC unit 13 is not constant, a buffer 14 temporally stores this data so that encoded data can be output at a constant bit rate.
In the prior art, DCT unit 11 divides an input image into smaller images of 8.times.8 blocks and then independently processes each sub-divided image block. Quantizer 12 quantizes the DCT coefficients at the quantization step size obtained in accordance with the state of buffer 14 and the complexity of the current input image. Therefore, if the difference between the quantization step sizes of adjacent macro blocks is large, the correlation between adjacent blocks is lost along the borders, which leads to a "block effect" phenomenon.
In addition, when quantization is performed using a constant quantization step size on the respective macro blocks, errors occur nonuniformly in the frame. This is because the complexity of each block is different even within a given frame, which results in an artifact being produced whereby the image quality of a specific portion is deteriorated. Therefore, it is critical that a proper quantization step size should be determined in order to prevent generation of an artifact.
On the other hand, since the code length generated in the variable length coding is variable, reproduction is difficult when performing special reproducing functions, such as during a high speed search. Accordingly, the bit quantity must be controlled so as to be constant. Also, the quantization step size of the quantizing unit is determined by a scale factor, which is an important parameter for determining the bit rate, and in turn determines the compression ratio and affects the resolution of the frame.
However, as shown in FIG. 1, when a buffer 14 is used to provide a constant bit quantity, since the quantization step size is controlled by the fullness ratio of the buffer, or in other words the degree to which the buffer is full, there may be difficulty in the bit allocation for a specific region (or macro block) in adapting to the complexity of a frame.
Further, U.S. Pat. No. 5,253,075 discloses an image signal encoding/decoding system in which, after the complexity of a DCT transform block is detected, the quantization step size of the quantizer is adaptively controlled in accordance with the relationship of adjacent DCT transform blocks, so as to alleviate the block effect phenomenon. In such an apparatus, the complexity of an image is detected based on frequency domain information so as to control the quantization step size. However, such an image encoding/decoding system fails to provide a means for encoding a specific block (or macro block) at a constant bit rate.